package taishan

var Api = api{}

type api struct {
}

func (that *api) SetMiddlewares(engine *Engine, host string, routeRule string, middlewares ...IMiddleware) error {
	route := engine.routers.Get(host)
	return route.updateMiddlewares(routeRule, middlewares...)
}

func (that *api) UpdateRouterHandler(engine *Engine, host string, method string, routeRule string, handler HandlerFunc) error {
	route := engine.routers.Get(host)
	return route.updateRoute(method, routeRule, handler)
}
